import urllib3

url = 'http://www.qiushibaike.com/text/'
try:
    request = urllib3.request(url)
    response = urllib3.urlopen(request)
    print (response.read())
except Exception as e:
    if hasattr(e,"code"):
        print (e.code)
    if hasattr(e,"reason"):
        print (e.reason)